﻿{% extends 'base.html' %}
{% block extrahead %}
<script type="text/javascript" src="/js/AFM.js">
</script>
{% endblock %}
{% block contents %}
<div id="inputForm">
    <form name = "createForm" action="." method="post" id="createForm">
        <div class="field"  tooltip="Το Α.Φ.Μ. της απόδειξής.">
            <div class="labels">
                <label for="id_afm">
                    Α.Φ.Μ
                </label>
            </div>
            <div>
                {{receiptform.afm}}
            </div>
        </div>
        <div class="field" tooltip="Το συνολικό ποσό της απόδειξης.">
            <div class="labels">
                <label for="id_amount">
                    ΠΟΣΟ
                </label>
            </div>
            <div>
                {{receiptform.amount}}
            </div>
        </div>
        <div class="field" tooltip="Η ημερομηνία έκδοσης της απόδειξης.">
            <div class="labels">
                <label for="id_date">
                    ΗΜΕΡΟΜΗΝΙΑ
                </label>
            </div>
            <div>
                {{receiptform.date}}
            </div>
        </div>
        <div class="field" tooltip="Το κατάστημα στο οποίο εκδόθηκε η απόδειξη. Γράψτε το για δική σας ευκολία.">
            <div class="labels">
                <label for="id_storeDescription">
                    ΠΕΡΙΓΡΑΦΗ 
                </label>
            </div>
            <div>
                {{receiptform.storeDescription}}
            </div>
        </div>
        {{form.as_p}}
		{% ifequal mode "edit" %}
		<input type="hidden" name="mode" value="edit">
		<input type="hidden" name="key" value="{{ key }}">
		{% else %}
		<input type="hidden" name="mode" value="normal">
		{% endifequal %}
    </form>
    <div id = "submitButton" title = "πρόσθεσε την απόδειξη" onclick ="document.forms['createForm'].submit();">
    </div>
</div>
<div class="clear"></div>

{{receiptform.afm.errors}}
{{receiptform.amount.errors}}
{{receiptform.date.errors}}
{{receiptform.storeDescription.errors}}
<br /><br />
<div id = "receiptList">
	<ul>	
		{% for receipt in receiptList %}
		<li class= "{% cycle odd,even %}">
			<span id = "afm" class = "listElement">{{ receipt.afm }}</span>
			<span id = "amount" class = "listElement">{{ receipt.amount }}</span>
			<span id = "date" class = "listElement">{{ receipt.date }}</span>
			<span id = "storeDescription" class = "listElement">{{ receipt.storeDescription }}</span>
		<a href="/edit/{{ receipt.key }} " >
			<span class = "editBtn" title="τροποποίησε αυτή την απόδειξη"></span>
		</a>
		</li>
		{% endfor %}
	</ul> 
</div>
{% endblock %}
{% block beforeEnd %}
{% endblock %}
